﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Converters="using:Callisto.Converters">

    <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <DataTemplate x:Key="Nav250x250ItemTemplate">
        <Grid HorizontalAlignment="Left" Width="250" Height="100">
            <StackPanel VerticalAlignment="Top" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
                <TextBlock Text="{Binding No}" Foreground="White" FontSize="24" Margin="15,0,15,5"/>
                <TextBlock Text="{Binding Description}" Foreground="White" FontSize="20" TextWrapping="NoWrap" Margin="15,0,15,5"/>
                <TextBlock Text="{Binding Inventory, Converter={StaticResource StringFormatConvert}, ConverterParameter='{}On Hand : {0}'}" Foreground="White" FontSize="20" TextWrapping="NoWrap" Margin="15,0,15,5"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="NavStandard80ItemTemplate">
        <Grid Margin="6">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="1" Margin="10,0,0,0">
                <TextBlock Text="{Binding No}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/>
                <TextBlock Text="{Binding Description}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <Style x:Key="IDBasicTextStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
        <Setter Property="TextTrimming" Value="WordEllipsis"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="Typography.StylisticSet20" Value="True"/>
        <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
        <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
    </Style>

    <Style x:Key="IDBaselineTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBasicTextStyle}">
        <Setter Property="LineHeight" Value="20"/>
        <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
        <!-- Properly align text along its baseline -->
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform X="-1" Y="4"/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="IDHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontSize" Value="36"/>
        <Setter Property="FontWeight" Value="Light"/>
        <Setter Property="LineHeight" Value="40"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform X="-2" Y="8"/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="IDSubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontSize" Value="26.667"/>
        <Setter Property="FontWeight" Value="Light"/>
        <Setter Property="LineHeight" Value="30"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform X="-1" Y="6"/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="IDTitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontWeight" Value="SemiBold"/>
    </Style>

    <Style x:Key="IDSubtitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontWeight" Value="Normal"/>
    </Style>

    <Style x:Key="IDItemTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}"/>

    <Style x:Key="IDBodyTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontWeight" Value="SemiLight"/>
    </Style>

    <Style x:Key="IDCaptionTextStyle" TargetType="TextBlock" BasedOn="{StaticResource IDBaselineTextStyle}">
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
    </Style>

    <DataTemplate x:Key="ItemDetailTemplate">
        <Grid>
            <StackPanel VerticalAlignment="Top" Margin="110,127,117,0">
                <TextBlock Text="{Binding No}" Style="{StaticResource IDHeaderTextStyle}" MaxHeight="40"/>
                <TextBlock Text="{Binding Description}" Style="{StaticResource IDSubheaderTextStyle}" TextWrapping="NoWrap"/>
            </StackPanel>
        </Grid>
    </DataTemplate>
</ResourceDictionary>
